package com.hz.zbl.helper;

import javax.xml.bind.DatatypeConverter;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class StringHelper {

    public static String generateMD5(String input){
        try{
            MessageDigest md = MessageDigest.getInstance("MD5");
            md.update(input.getBytes());
            byte[] digest = md.digest();
            return DatatypeConverter.printHexBinary(digest);
        }catch (NoSuchAlgorithmException e){
            throw new RuntimeException(e);
        }
    }
}
